package Test

import (
	"fmt"
	"testing"
)


func IntMin(a,b int) int{
	if a<b {
		return a
	}
	return b
}


func TestIntMin(t *testing.T){
	ans := IntMin(1,2)
	if ans != 1 {
		t.Errorf("IntMin(2, -2) = %d; want -2", ans)
	}
}


func TestIntMinTableDriven(t *testing.T){
	tests := []struct{
		a,b int
		want int
	}{
		{1,2,1},
		{1,-1,-1},
		{-1,-2,-2},
	}
	for _,test := range tests{
		testName := fmt.Sprintf("[%d,%d]",test.a,test.b)
		t.Run(testName,func(t *testing.T) {
			ans := IntMin(test.a,test.b)
			if ans !=  test.want{
				t.Errorf("IntMin(2, -2) = %d; want -2", ans)	
			}
		})
	}
}

func main(){


}